home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club (Business) 1997 July / Software of the Month Club - Business (Volume 239) (July 1997).iso / pc / code / debug / mockmsg3.dir / 00002_main movie script.ls next >
Encoding:
Text File  |  1995-12-11  |  1.8 KB  |  65 lines

  1. global gQueryField, gOldStart, gMessageHolder, gLastMessage, gResultField
  2.  
  3. on startMovie
  4.   set the keyDownScript to "checkKey"
  5.   set gQueryField to "mockMessageWindow"
  6.   set gResultField to "resultWindow"
  7.   set the text of cast gQueryField to EMPTY
  8.   set the text of cast gResultField to EMPTY
  9.   set gOldStart to 0
  10.   set gLastMessage to EMPTY
  11. end
  12.  
  13. on checkKey
  14.   if the key = RETURN then
  15.     set oldText to field gQueryField
  16.     set scriptToDo to string(chars(field gQueryField, gOldStart, the selEnd))
  17.     set original to scriptToDo
  18.     if scriptToDo contains "put" then
  19.       set scriptToDo to "global gMessageHolder" & RETURN & scriptToDo && "into gMessageHolder"
  20.     end if
  21.     do(string(scriptToDo))
  22.     set tempDump to gMessageHolder & RETURN & field gResultField
  23.     set the text of field gResultField to tempDump
  24.   end if
  25. end
  26.  
  27. on SaveGameCheckWindow Data
  28.   put "Output" & RETURN after field gResultField
  29.   if listp(Data) then
  30.     put getaProp(getaProp(Data, #gStates), #curKey) & RETURN after field gResultField
  31.     put getaProp(Data, #dynamicData) & RETURN after field gResultField
  32.   end if
  33. end
  34.  
  35. on resizeFields
  36.   set theClicked to the clickOn
  37.   puppetSprite(theClicked, 1)
  38.   repeat while the stillDown
  39.     set mV to the mouseV
  40.     if mV < 44 then
  41.       set mV to 44
  42.     else
  43.       if mV > 172 then
  44.         set mV to 172
  45.       end if
  46.     end if
  47.     set the locV of sprite theClicked to mV
  48.     set the rect of cast "mockMessageWindow" to rect(0, 0, 315, mV)
  49.     set the rect of cast "resultWindow" to rect(0, mV + 5, 315, 210)
  50.     set the locV of sprite 2 to mV
  51.     updateStage()
  52.   end repeat
  53. end
  54.  
  55. on charToLine text, charNum
  56.   set soFar to 0
  57.   repeat with x = 1 to the number of lines in text
  58.     set soFar to soFar + length(line x of text) + 1
  59.     if soFar >= charNum then
  60.       exit repeat
  61.     end if
  62.   end repeat
  63.   put x
  64. end
  65.